package com.dynamicthreadpool.strategy;

import com.dynamicthreadpool.core.ResizeableArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

/**
 * ResizeableArrayBlockingQueue策略实现
 * 适用于需要动态调整队列大小的场景
 */
public class ResizeableArrayBlockingQueueStrategy implements QueueStrategy {

    @Override
    public BlockingQueue<Runnable> createQueue(int capacity) {
        // 创建可调整大小的数组阻塞队列
        return new ResizeableArrayBlockingQueue<>(capacity > 0 ? capacity : 100);
    }

    @Override
    public String getTypeName() {
        return "ResizeableArrayBlockingQueue";
    }
}
